package com.shiro.demo.entity;


import org.crazycake.shiro.AuthCachePrincipal;

import java.io.Serializable;
import java.util.List;

public class AutoToken implements AuthCachePrincipal,  Serializable {
    private String name;
    private List<String> roles;
    private List<String> permissions;

    public AutoToken(String name, List<String> roles, List<String> permissions) {
        this.name = name;
        this.roles = roles;
        this.permissions = permissions;
    }

    public AutoToken() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getRoles() {
        return roles;
    }

    public void setRoles(List<String> roles) {
        this.roles = roles;
    }

    public List<String> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<String> permissions) {
        this.permissions = permissions;
    }

    @Override
    public String getAuthCacheKey() {
        return name;
    }
}
